package com.hc.bean;

import com.hc.comm.CommData;
import com.hc.comm.Service.BSizeServie;

/**
 * 评分对象
 * @author tiansl
 *
 */
public class GradeBean {

	private int id;
	
	private int webtimedelayGrade;
	private int webShakeGrade;
	private int weblostRateGrade;
	
	private int webGrade;
	
	private String vlanId;

	private int webTestCount;
	
	private int downFileGrade;
	
	private int downFileTestCount;
	
	
	private int gradeCount;
	
	
	private String bSizeQuality;
	
	private String time;

	
	
	
	
	public GradeBean() {
		super();
	}


	public int getWebtimedelayGrade() {
		return webtimedelayGrade;
	}


	public void setWebtimedelayGrade(int webtimedelayGrade) {
		this.webtimedelayGrade = webtimedelayGrade;
	}


	public int getWebShakeGrade() {
		return webShakeGrade;
	}


	public void setWebShakeGrade(int webShakeGrade) {
		this.webShakeGrade = webShakeGrade;
	}


	public int getWeblostRateGrade() {
		return weblostRateGrade;
	}


	public void setWeblostRateGrade(int weblostRateGrade) {
		this.weblostRateGrade = weblostRateGrade;
	}


	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}



	public int getWebGrade() {
		
		return (this.weblostRateGrade+this.webShakeGrade+this.webtimedelayGrade)/3;
	}





	public int getGradeCount() {
		return (int) ((this.getWebGrade()+this.downFileGrade)/2);
	}


	public String getbSizeQuality() {
		
		
		bSizeQuality = "";
		
		BSizeBean bean = BSizeServie.getBSizeBean("评分分级");
		
		if(bean!=null){
			
			if(getGradeCount()>=bean.getMaxSpeed()){
				
				bSizeQuality =  "好";
			}else if(getGradeCount()<bean.getMaxSpeed()&&getGradeCount()>=bean.getMinSpeed()){
				
				bSizeQuality = "良";
			}else{
				
				bSizeQuality =  "差";
				
			}
		}else{
			bSizeQuality="找不到评分的标准，请在评分配置中添加一个评分等级的配置";
			
		}
		
		
		
		
		
		return bSizeQuality;
	}


	public int getWebTestCount() {
		return webTestCount;
	}

	public void setWebTestCount(int webTestCount) {
		this.webTestCount = webTestCount;
	}

	public int getDownFileGrade() {
		return downFileGrade;
	}

	public void setDownFileGrade(int downFileGrade) {
		this.downFileGrade = downFileGrade;
	}

	public int getDownFileTestCount() {
		return downFileTestCount;
	}

	public void setDownFileTestCount(int downFileTestCount) {
		this.downFileTestCount = downFileTestCount;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getVlanId() {
		return vlanId;
	}

	public void setVlanId(String vlanId) {
		this.vlanId = vlanId;
	}

	


	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "vlanId = "+this.vlanId+" , time = "+time+" webTestCount= "+webTestCount+" downFileTestCount = "+downFileTestCount+" downFileGrade = "+downFileGrade;
	}
}
